#ifndef INFOCONTAINER_H
#define INFOCONTAINER_H

#include <iostream>
#include <fstream>
#include <map>
#include <vector>
#include <string>
#include <stdio.h>
#include <string.h>
using namespace std;

#define ZigBeeID "../InitFile/ZigBeeID"
#define Sensor_Terminal "../InitFile/Sensor&Terminal"
#define Roomnum "../InitFile/RoomNum"
#define DevMes "../InitFile/DevName"

struct DevInformation
{
   int RoomNum;
   int DevType;
};

class CInfoContainer
{
public:
    static CInfoContainer * GetInstance();
    bool Init();
    bool GetSensorRoomInfo(const string & ZigBee, int & RoomNum);
    bool GetSensorTypeInfo(const string & ZigBee, int & DevType);

    bool GetTerminalRoomInfo(const string & ZigBee, int & RoomNum);
    bool GetTerminalTypeInfo(const string & ZigBee, int & DevType);

    bool GetZigBeeRelationInfo(const string & Sensor, vector <string> & Terminal);

    bool GetZigBeeID(const string & DevName, string & ZigbeeID);
    bool GetRoomNum(const string & RoomName, int & RoomNum);

    int GetRoom();
    void Cleanup();

private:
    CInfoContainer();
    ~CInfoContainer();
    static CInfoContainer * InfoContainer;
    bool InsertZigBeeTypeInfo();
    bool InsertZigBeeRelationInfo();
    bool InsertRoom();
    bool InsertZigbeeID();

private:
    map <string, string> ZigbeeMessage;
    map <string, int> RoomMessage;
    map <string, DevInformation > ZigBeeTypeInfo;    //保存ZigBee节点所在的房间号以及其设备类型
    map <string, vector <string> > ZigBeeRelationInfo;  //保存ZigBee节点中传感器设备与终端设备的关联
    int Room;
};



#endif // INFOCONTAINER_H
